<template>
  <div class="ii-wrap">
    <div class="ii-wrap-left">
      <div class="ii-wrap-left-one" :class="helpIndex === 0 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(0)"><p>平台介绍</p></div>
      <div class="ii-wrap-left-one" :class="helpIndex === 1 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(1)"><p>直播知识</p></div>
      <div class="ii-wrap-left-one" :class="helpIndex === 2 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(2)"><p>关于伙达</p></div>
      <div class="ii-wrap-left-one" :class="helpIndex === 3 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(3)"><p>常见问题</p></div>
    </div>
    <div class="li-wrap-right">
      <nuxt-child/>
    </div>
  </div>
</template>
<script>
export default {
  async fetch({store}) {
    await store.commit('setInterIndex', 6)
    // await store.commit('setHelpIndex',0 )
  },
  layout: 'internalouts',
  components: {
    
  },
  computed: {
    helpIndex() {
      return this.$store.state.helpIndex
    }
  },
  data() {
    return {
      index: 0, // 当前选择的页面，
    }
  },
  methods: {
    toggleIndex(index) {
      this.index = index
      this.$store.commit('setHelpIndex',index)
      switch(index) {
        case 0:
          this.go('/help')
          break;
        case 1:
          this.go('/help/live')
          break;
        case 2:
          this.go('/help/about')
          break;
        case 3:
          this.$store.commit('setIsShow',-1)
          this.go('/help/question')
          break;
      }
    },
    getData(){ //热销商品
      let params ={
      }
      this.$axios.$post('hotsList',params).then(res => {
        if(res.status === 200 ){
        }else{
          this.$message.warning(res.msg)
        }
      })
      .catch(error => {
          this.$message.warning('请求失败')
      })
    }
  },
  mounted(){
    // this.getData()
  }
}
</script>

<style scoped>
  .ii-wrap {
    display: flex;
    justify-content: space-between;
    min-width:1200px;
  }
  .ii-wrap-left {
    background: #efefef;
    width: 220px;
    border-radius: 4px;
  }
  .li-wrap-right {
    flex:1;
    margin: 20px;
    min-width:940px;
  }
  .ii-wrap-left-one {
    border-bottom: 1px solid #f4f4f4;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding: 18px 30px;
    text-align: justify;
    display:flex;
  }
  .ii-wrap-left-one p {
    width:160px;
    overflow: hidden;
    display: -webkit-box;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height:1.3;
  }
  .ii-wrap-left-one1 {
    border-bottom: 1px solid #f4f4f4;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding: 18px 30px;
    text-align: justify;
    display:flex;
  }
  .ii-wrap-left-one1 p {
    width:160px;
    overflow: hidden;
    display: -webkit-box;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height:1.3;
  }
  .ii-wrap-left-item {
    border-bottom: 1px solid #f4f4f4;
    padding-bottom: 20px;
    user-select: none;
  }
  .ii-wrap-left-item p {
    cursor: pointer;
  }
  .ii-wrap-left-item .p1 {
    font-size: 14px;
    color: #333;
    position: relative;
    height: 50px;
    line-height: 50px;
    padding-left: 30px;

  }
  .ii-wrap-left-item .p2 {
    font-size: 14px;
    color: #666;
    padding-left: 30px;

  }
  .ii-wrap-left-item .p3 {
   margin-top: 20px;
  }
  .ii-wrap-left-last {
    height: 50px;
    line-height: 50px;
    padding-left: 30px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    position: relative;
  }
  .ii-line-active::before {
    content: '';
    width: 3px;
    height: 26px;
    background: #0096e6;
    position: absolute;
    left: 0;
    top: 15px;
  }
  .ii-line-active1::before {
    content: '';
    width: 3px;
    height: 26px;
    background: #0096e6;
    position: absolute;
    left: 0;
    top: 24px;
  }
  .ii-text-active {
    color: #0096e6 !important;
    background:#e6e6e6;
  }
</style>
